#ifndef DockSplitterH
#define DockSplitterH
/*******************************************************************************
** Qt Advanced Docking System
** Copyright (C) 2017 Uwe Kindler
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License as published by the Free Software Foundation; either
** version 2.1 of the License, or (at your option) any later version.
**
** This library is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
** Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public
** License along with this library; If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/


//============================================================================
/// \file   DockSplitter.h
/// \author Uwe Kindler
/// \date   24.03.2017
/// \brief  Declaration of CDockSplitter
//============================================================================

//============================================================================
//                                   INCLUDES
//============================================================================
#include <QSplitter>

#include "ads_globals.h"

namespace ads
{
// 前置声明
struct DockSplitterPrivate;

/**
 * CDockSplitter是QSplitter的子类，具有额外的功能。
 */
class ADS_EXPORT CDockSplitter : public QSplitter
{
    Q_OBJECT
private:
    DockSplitterPrivate* d; // 私有成员
    friend struct DockSplitterPrivate; // 友元结构体

public:
    // 构造函数
    CDockSplitter(QWidget *parent = Q_NULLPTR);
    CDockSplitter(Qt::Orientation orientation, QWidget *parent = Q_NULLPTR);

    // 析构函数
    virtual ~CDockSplitter();

    // 判断是否有可见的子控件
    bool hasVisibleContent() const;

    // 获取第一个子控件
    QWidget* firstWidget() const;

    // 获取最后一个子控件
    QWidget* lastWidget() const;

    // 判断是否包含dock manager的中央控件
    bool isResizingWithContainer() const;
};

} // namespace ads

//---------------------------------------------------------------------------
#endif // DockSplitterH
